package com.zl.util;

import java.util.List;

import net.sf.json.JSONObject;

public class JqPage<T> {
	private int iTotalRecords;
	private int iTotalDisplayRecords;
	private String sEcho;
	private List<T> aaData;

	public JqPage(int iTotalRecords, int iTotalDisplayRecords, String sEcho,
			List<T> aaData) {
		this.iTotalRecords = iTotalRecords;
		this.iTotalDisplayRecords = iTotalDisplayRecords;
		this.sEcho = sEcho;
		this.aaData = aaData;
	}

	public JSONObject toJsonObj() {
		return new JSONObject().accumulate("sEcho", this.sEcho)
				.accumulate("iTotalRecords", this.iTotalRecords)
				.accumulate("iTotalDisplayRecords", this.iTotalDisplayRecords)
				.accumulate("aaData", this.aaData);
	}
}
